package com.sailfish.springbootdemo.service.db2;

import com.sailfish.springbootdemo.pojo.Result;
import com.sailfish.springbootdemo.pojo.db2.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface PcbCapacityParamService {

    List<PcbCapacityParam> getChildrenById(Integer id, String paramName, Integer status);

    List<PcbCapacityParamHistory> getChildrenByIdHistory(Integer id, String version);

    Result delete(Integer id);

    Result insertOrUpdate(String data);

    Result updateRequire(Integer isRequire);

    Result checkHasNotApproved();

    Result getParamList(Integer id1, Integer id2, Integer id3, Integer level, String searchK, String searchV);

    Result getParamListHistory(Integer id1, Integer id2, Integer id3, Integer level, String searchK, String searchV, String version);

    List<PcbCapacityParam> getChildrenWithData(Integer id, Integer pcbCapacityHistoryId, Integer pcbFactoryId, Integer valueType);

    List<PcbCapacityParamHistory> getChildrenWithDataHistory(Integer id, Integer pcbFactoryId, Integer valueType, String version);

    List<PcbCapacityParam> getCapacityComparison(Integer id, Integer pcbCapacityHistoryId, List<Integer> pcbFactoryIds);

    List<PcbCapacityParamHistory> getCapacityComparisonHistory(Integer id, List<Integer> pcbFactoryIds, String version);

    Result saveOldParamTemplate(String oldVersionYear, String oldVersionNum);

    Result saveOldParamTemplate2(String newVersionYear, String newVersionNum);

    List<PcbCapacityParamVersion> getVersionList(String versionYear, Integer versionType);

    List<PcbCapacityParamVersion> getVersionListByTemplateStatus(String versionYear, Integer versionType);

    Result checkOldParamTemplate(String oldVersionYear, String oldVersionNum, Integer versionType);

    Result outputCapacityComparison(Integer id, Integer pcbCapacityHistoryId, List<Integer> pcbFactoryIds, String version, Integer type) throws IOException;

    Result outputCapacityComparisonFactory(Integer id, Integer pcbCapacityHistoryId, List<Integer> pcbFactoryIds, String version) throws IOException;

    Result outputParamTemplate(String version) throws IOException;

//     List<Integer> getCapacityMatchFactory(List<PcbSonFactoryInfo> sonFactoryInfoList, Map<String,Double> requireDatas);

    Result importParamTemplate(MultipartFile file, String type) throws IOException;

    Result importParamTemplate2(MultipartFile file, String type) throws IOException;

    Boolean checkHasSonParam(Integer paramId);

    Result publishTemplate();

    Result deleteHistoryTemplate(String version);

    PcbCapacityParamVersion getNewestVersion(String versionYear, Integer versionType);

    PcbCapacityParamVersion getNewestVersionByTemplateStatus(String versionYear, Integer versionType);

    Result saveTemplate(String versionYear, String versionNum);

}
